package org.alex.netShop.beans;

import java.util.LinkedList;
import java.util.List;

import org.alex.netShop.interfaces.Customer;
import org.alex.netShop.interfaces.Product;
import org.alex.netShop.interfaces.Seller;
import org.alex.netShop.interfaces.Test;

import org.alex.netShop.service.PurchaseUniqueID;
import org.alex.netShop.service.Purchases;
import org.alex.netShop.service.TestUniqueID;
import org.alex.netShop.service.Tests;


public class TestBean implements  Test {
	
	private Customer customer;
	private Seller seller;
	private List<Product> product;
	private String id;
	
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.TestEquipment#getCustomer()
	 */
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.Test#getCustomer()
	 */
	public Customer getCustomer() {
		return customer;
	}
	
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.TestEquipment#setCustomer(org.alex.netShop.interfaces.Customer)
	 */
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.Test#setCustomer(org.alex.netShop.interfaces.Customer)
	 */
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.TestEquipment#getSeller()
	 */
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.Test#getSeller()
	 */
	public Seller getSeller() {
		return seller;
	}
	
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.TestEquipment#setSeller(org.alex.netShop.interfaces.Seller)
	 */
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.Test#setSeller(org.alex.netShop.interfaces.Seller)
	 */
	public void setSeller(Seller seller) {
		this.seller = seller;
	}
	
	
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.TestEquipment#getProduct()
	 */
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.Test#getProduct()
	 */
	public List<Product> getProduct() {
		return product;
	}

	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.TestEquipment#setProduct(java.util.List)
	 */
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.Test#setProduct(java.util.List)
	 */
	public void setProduct(List<Product> product) {
		this.product = product;
	}

	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.TestEquipment#getId()
	 */
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.Test#getId()
	 */
	public String getId() {
		return id;
	}
	
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.TestEquipment#setId(java.lang.String)
	 */
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.Test#setId(java.lang.String)
	 */
	public void setId(String id) {
		this.id = id;
	}
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.TestEquipment#executeBorrowCreation(org.alex.netShop.interfaces.Seller, org.alex.netShop.interfaces.Customer, org.alex.netShop.interfaces.Product, org.alex.netShop.service.Purchases)
	 */
	/* (non-Javadoc)
	 * @see org.alex.netShop.beans.Test#executeBorrowCreation(org.alex.netShop.interfaces.Seller, org.alex.netShop.interfaces.Customer, org.alex.netShop.interfaces.Product, org.alex.netShop.service.Purchases)
	 */
	public void executeBorrowCreation(Seller seller, Customer customer, Product product, Tests tests){
		
		
		this.setId(TestUniqueID.getTestUniqueID());
		this.setSeller(seller);
		this.setCustomer(customer);
		List<Product> p = new LinkedList<Product>();
		p.add(product);
		
		this.setProduct(p);
				
		seller.getTest().add(this);
		product.getTest().add(this);
		customer.getTest().add(this);
		
		tests.save(this);
		

	}

	public void executeBorrowCreation(Seller seller, Customer customer,
			Product product, Test tests) {
		// TODO Auto-generated method stub
		
	}

}
